import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

//引入element-ui组件
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

//引入全局样式
import "@/styles/index.less";

//引入全局指令
import { draggable } from "@/utils/directives.js";
Vue.directive("draggable", draggable);

//封装弹窗
import modal from "@/plugins/modal.js";
Vue.prototype.$modal = modal;

//替换  社会接班人
// import "@/utils/testReplace.js";

//引入全部过滤器
import * as filters from "@/filters/index.js";
const keys = Object.keys(filters);

keys.forEach((key) => {
  const filterName = key;
  const filterFun = filters[key];
  Vue.filter(filterName, filterFun);
});

Vue.config.errorHandler = (err, vm, info) => {
  console.log("err", err);
  console.log("vm", vm);
  console.log("info", info);
};

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
